package com.devops.admin.graphql;

import com.devops.admin.po.DOSVersionOperationLogPo;
import com.devops.admin.service.DOSProjectVersionOperateLogService;
import com.devops.admin.vo.DOSVersionOperationLogVo;
import com.devops.constant.DevOpsConstant;
import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsQuery;
import com.netflix.graphql.dgs.InputArgument;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClassName DOSProjectVersionOperateLogDataFetcher
 * @Description TODO
 * @Author heyabo
 * @Date 2022/8/4 10:38
 * @Version 1.0
 **/
@DgsComponent
public class DOSProjectVersionOperateLogDataFetcher {

    @Autowired
    private DOSProjectVersionOperateLogService dosProjectVersionOperateLogService;

    @DgsQuery
    @RequiresPermissions(DevOpsConstant.RoleCode.LOGIN_USER)
    public List<DOSVersionOperationLogPo> getOperationLog(@InputArgument DOSVersionOperationLogVo operationLog){

        return dosProjectVersionOperateLogService.getOperationLogs(operationLog);
    }
}
